home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 12 / Mac Magazin and MacEasy Magazine CD - Issue 12.iso / Sharewarebibliothek / Anwendungen / Wissenschaft & Technik / Finder Marquee ƒ / finder_marquee.h < prev    next >
Text File  |  1995-07-10  |  2KB  |  62 lines

  1. /*
  2.  
  3.     Finder Marquee
  4.     by Jordan Zimmerman
  5.     (c)1995 by Altura Software, Inc.
  6.  
  7.     Unlimited use is hereby granted without restriction.  However,
  8.     the author would appreciate credit if possible.  Please send
  9.     comments, questions, bugs, etc. to jordanz@altura.com
  10.     
  11.     This code implements a "rubber band" marquee select rect
  12.     with very smooth drawing in a manner similar to the Mac Finder.
  13.  
  14. */
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif    // __cplusplus
  19.  
  20. struct finder_marquee_rec;    // forward declaration
  21.  
  22. // return true if the selection will change, false if not
  23. typedef int        (*finder_marquee_check_selections_proc_t)(struct finder_marquee_rec* marquee_ptr);
  24.  
  25. // change the selections based on the new marquee_r
  26. typedef void    (*finder_marquee_change_selection_proc_t)(struct finder_marquee_rec* marquee_ptr, const Rect* old_marquee_r_ptr);
  27.  
  28. typedef struct finder_marquee_rec
  29. {
  30.     
  31.         // the following are two optional callbacks - set NULL if you're not using them
  32.     finder_marquee_check_selections_proc_t    selections_proc;            // return true if the selection will change, false if not
  33.     finder_marquee_change_selection_proc_t    change_selection_proc;        // change the selections based on the new marquee_r
  34.  
  35.     void*                                    user_ptr;    // put whatever you want here
  36.  
  37.         // the following fields are filled by the library
  38.     Rect                                    marquee_r;    // current marquee_r
  39.     Point                                    pin_pt;        // mouse down point
  40.     Point                                    current_pt;    // current mouse location
  41.  
  42. } finder_marquee_rec;
  43.  
  44. // call to begin the marquee select - port must be set
  45. // marquee_ptr is a pointer to a finder_marquee_rec structure for the library to use
  46. // mouse_down_pt is where the mouse went down in local coordinates
  47. void FinderMarqueeBegin(finder_marquee_rec* marquee_ptr, Point mouse_down_pt);
  48.  
  49. // call to continue with marquee selection - port must be set
  50. // marquee_ptr should be a pointer to the same finder_marquee_rec passed to FinderMarqueeBegin
  51. // new_mouse_pt is the current mouse position in local coordinates
  52. void FinderMarqueeContinue(finder_marquee_rec* marquee_ptr, Point new_mouse_pt);
  53.  
  54. // call when finished with marquee selection - port must be set
  55. // marquee_ptr should be a pointer to the same finder_marquee_rec passed to FinderMarqueeBegin
  56. // you can use marquee_r to get the final selection rectangle
  57. void FinderMarqueeEnd(finder_marquee_rec* marquee_ptr);
  58.  
  59. #ifdef __cplusplus
  60. }
  61. #endif    // __cplusplus
  62.